DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomDataSet Class / AddByReference Method / AddByReference(Keyword,Byte[]) Method
Attribute tag to add
Attribute value as byte array
Example

In This Topic
    AddByReference(Keyword,Byte[]) Method
    In This Topic
    Add byte[] as attribute value to avoid copying large data
    Syntax
    'Declaration
     
    
    Public Overloads Sub AddByReference( _
       ByVal keyword As Keyword, _
       ByVal Value() As System.Byte _
    ) 
    public void AddByReference( 
       Keyword keyword,
       System.byte[] Value
    )

    Parameters

    keyword
    Attribute tag to add
    Value
    Attribute value as byte array
    Example
    DicomDataSet ds = new DicomDataSet();
                        
    Keyword patientNameKeyword = Keyword.PatientName;
    string patientName = "John Doe";
    byte[] patientNameBytes = Encoding.ASCII.GetBytes(patientName);
                        
    ds.AddByReference(patientNameKeyword, patientNameBytes);
    var pn = ds[Keyword.PatientName].Value.ToString(); // John Doe
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also